package com.itheima.bigdecimal;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class TestStudent {
    public static void main(String[] args) {
//        张三,男,20,79.5
//        李四,女,21,80.2
//        王五,男,22,77.9
//        周六,男,20,55.8
//        赵七,女,21,99.9
        Student s1=new Student( "张三","男","20","79.5");
        Student s2=new Student( "李四","女","21","80.2");
        Student s3=new Student( "王五","男","22","77.9");
        Student s4=new Student( "周六","男","20","55.8");
        Student s5=new Student( "赵七","女","21","99.9");
        BigDecimal ss1=new BigDecimal(s1.getMark());
        BigDecimal ss2=new BigDecimal(s2.getMark());
        BigDecimal ss3=new BigDecimal(s3.getMark());
        BigDecimal ss4=new BigDecimal(s4.getMark());
        BigDecimal ss5=new BigDecimal(s5.getMark());
        BigDecimal ss6=ss1.add(ss2).add(ss3).add(ss4).add(ss5);
        BigDecimal ss7=new BigDecimal("5");
        BigDecimal divide = ss6.divide( ss7, 2,RoundingMode.HALF_UP);
        System.out.println(divide);
    }
}
